<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      body {
        perspective: 500px;
      }
      .box {
        position: relative;
        width: 200px;
        height: 50px;
        margin: 100px auto;
        transition: all 1s;
        transform-style: preserve-3d;
      }
      .front,
      .down {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: pink;
        font-size: 20px;
        color: #ffffff;
        line-height: 50px;
        text-align: center;
      }
      .front {
        background-color: purple;
        z-index: 1;
        transform: translateZ(25px);
      }
      .down {
        /* transform: rotateY(180deg),rotateX(-90deg); */
        transform: translateY(50%) rotateX(-90deg);
      }
      .box:hover {
        transform: rotateX(90deg);
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="front">黑马程序员</div>
      <div class="down">前端58</div>
    </div>
  </body>
</html>
